package com.dhcc.bpm.modules.scf.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 发票信息表实体类
 */
@Data
@TableName("scf_invoice_info")
public class ScfInvoiceInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 编号
     */
    @TableId(value = "ROW_ID", type = IdType.INPUT)
    private String rowId;

    /**
     * 发票代码
     */
    @TableField("INVOICE_CODE")
    @ExcelProperty("发票代码")
    private String invoiceCode;

    /**
     * 发票号码
     */
    @TableField("INVOICE_NUM")
    @ExcelProperty("发票号码")
    private String invoiceNum;

    /**
     * 发票种类
     */
    @TableField("INVOICE_TYPE")
    @ExcelProperty("发票种类")
    private String invoiceType;

    /**
     * 开票方
     */
    @TableField("INVOICER_NAME")
    @ExcelProperty("销售方")
    private String invoicerName;

    /**
     * 购买方
     */
    @TableField("BUYER_NAME")
    @ExcelProperty("购买方")
    private String buyerName;

    /**
     * 开票日期
     */
    @TableField("INVOICE_DATE")
    @ExcelProperty("开票日期")
    private String invoiceDate;


    /**
     * 金额（不含税金额）
     */
    @TableField("GOOD_AMOUNT")
    @ExcelProperty("不含税合计（元）")
    @JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
    private BigDecimal goodAmount;

    /**
     * 税率
     */
    @TableField("TAX_RATE")
    @ExcelProperty("税率")
    private String taxRate;

    /**
     * 税额
     */
    @TableField("TAX_AMOUNT")
    @ExcelProperty("税额（元）")
    @JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
    private BigDecimal taxAmount;

    /**
     * 含税总金额-由不含税额+税额计算得到
     */
    @TableField("TOTAL_AMOUNT")
    @ExcelProperty("价税合计（元）")
    @JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
    private BigDecimal totalAmount;

    /**
     * 回单交易流水号-一个发票对应一个支付
     */
    @TableField("PAYMENT_NUM")
    @ExcelProperty("对应支付单编号")
    private String paymentNum;

    /**
     * 关联状态（是否关联到支付回单）
     */
    @TableField("ASSOCIATION_STS")
    private String associationSts;

    /**
     * 录入人
     */
    @TableField("RECORDER")
    private String recorder;

    /**
     * 录入日期
     */
    @TableField("RECORD_DATE")
    private String recordDate;

    /**
     * 录入时间
     */
    @TableField("RECORD_TIME")
    private String recordTime;

    @TableField("ORG_CODE")
    @ExcelProperty("所属公司编码")
    private String orgCode;
}
